<%@ page language="java" contentType="application/octet-stream;charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.service.*" %>
<%
	out.clear();
	out = pageContext.pushBody(); 
	
	
	String excelTitle = "월검색빈도";
	
	response.setHeader("Content-Disposition","attachment;filename="+java.net.URLEncoder.encode(excelTitle, "utf-8")+"_"+StringUtil.today()+".xls");
	response.setHeader("Content-Description","JSP Generated Data");

	String s_from_dt		= StringUtil.nvl(request.getParameter("s_from_dt"), TODAY.substring(0,6)+"01");
	String s_to_dt			= StringUtil.nvl(request.getParameter("s_to_dt"), TODAY);
	String s_service_type	= StringUtil.nvl(request.getParameter("s_service_type"));
	String s_owner_code		= StringUtil.nvl(request.getParameter("s_owner_code"));



	HashMap infos = new HashMap();
	infos.put("from_dt",		s_from_dt);
	infos.put("to_dt",			s_to_dt);
	infos.put("service_type", 	s_service_type);
	infos.put("owner_code", 	s_owner_code);

	ServiceDAO dao 	= new ServiceDAO();
	HashList list 	= dao.selectServiceCountMonthly(infos);
 
	list.setSearch("조회기간", s_from_dt + "~" + s_to_dt);
	
	list.setHeader("rank", 			"순위", 		MetaData.ALIGN_CENTER);
	list.setHeader("service_type", 	"유형",		MetaData.ALIGN_CENTER);
	list.setHeader("owner_name", 	"공급주체",	MetaData.ALIGN_LEFT);
	list.setHeader("service_name", 	"서비스명",	MetaData.ALIGN_LEFT);
	list.setHeader("dept_name", 	"담당부서",	MetaData.ALIGN_LEFT);
	list.setHeader("hit_count", 	"조회수",	MetaData.ALIGN_RIGHT);
	
	list.writeToExcel(response, excelTitle);
%>
